package com.rxjava.simplezip;

/**
 * Created by iceGeneral on 2016/10/15.
 */
public class Test {
    public static void main(String[] args) {

        Observable<Integer> o1 = Observable.create(new OnSubscribe<Integer>() {
            @Override
            public void call(Subscriber<? super Integer> subscriber) {
                subscriber.onNext(7);
                subscriber.onNext(8);
                subscriber.onNext(9);
            }
        });
        Observable<String> o2 = Observable.create(new OnSubscribe<String>() {
            @Override
            public void call(Subscriber<? super String> subscriber) {
                subscriber.onNext("A");
                subscriber.onNext("B");
                subscriber.onNext("C");
            }
        });
        Observable.zip(o1, o2, new Func2<Integer, String, String>() {
            @Override
            public String call(Integer integer, String s) {
                return "zip" + integer + s;
            }
        }).subscribe(new Subscriber<String>() {
            @Override
            public void onNext(String s) {
                System.out.println(s);
            }
        });

    }

}
